import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/home',
    name: 'home',
    component: HomeView,
    redirect:'/',
    children:[
      {path: '/', component: () => import('../views/homecontent/Homecontent.vue')},
      {path: '/buy', component: () => import('../views/buy/Buy.vue')},
      {path: '/sell', component: () => import('../views/sell/Sell.vue')},
      {path: '/news', component: () => import('../views/news/News.vue')},
      {path: '/identify', component: () => import('../views/identify/Identify.vue')},
      {path: '/p/role', component: () => import('../views/homecontent/role/UserRole.vue')},
      {path: '/p/private', component: () => import('../views/homecontent/role/Private.vue')},
      {path: '/goods/details', component: () => import('../views/goods/GoodDetail.vue')},
      {path: '/allgames/Games', component: () => import('../views/allgames/Games.vue')},
      {path: '/personal/details', component: () => import('../views/personal/PersonalCenter.vue'),redirect:'/personal/details/finished', children:[
          {path: '/personal/details/finished', component: () => import('@/views/personal/bought/FinishedView.vue')},
          {path: '/personal/details/other', component: () => import('@/views/personal/bought/OtherView.vue')},
          {path: '/personal/details/goods', component: () => import('@/views/personal/release/GoodsView.vue')},
          {path: '/personal/details/competition', component: () => import('@/views/personal/release/CompetitionView.vue')},
          {path: '/personal/details/selled', component: () => import('@/views/personal/myselled/SelledView.vue')},
          {path: '/personal/details/seniorIdentify', component: () => import('@/views/personal/identify/SeniorIdentifyView.vue')},
          {path: '/personal/details/commonIdentify', component: () => import('@/views/personal/identify/CommonIdentifyView.vue')},
              {path: '/personal/details/withdraw', component: () => import('@/views/personal/wallet/WithdrawView.vue')},
              {path: '/personal/details/violationHandle', component: () => import('@/views/personal/wallet/ViolationHandleView.vue')},
              {path: '/personal/details/transaction', component: () => import('@/views/personal/wallet/TransactionView.vue')},
              {path: '/personal/details/mySet', component: () => import('@/views/personal/set/MySet.vue')},
        ]},
      {path: '/buy/gameType', component: () => import('../views/type/GameType.vue')},

    ]
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router